<template>
	<view class="list">
		<view class="list-item">
			<image :src="realmName+details.picUrl"
				class="shopping" mode="aspectFit"></image>
			<view class="form">
				<view class="title">{{details.carName}}</view>
				<view class="form-item" v-if="details.seats">
					<view class="form-item-label">座位数</view>
					<view class="form-item-value">{{details.seats}}</view>
				</view>
				<view class="form-item" v-if="details.halfDayPrice">
					<view class="form-item-label">半天价格</view>
					<view class="form-item-value">
						<text>￥{{details.halfDayPrice}}</text>
						<text class="dan-wei">起</text>
					</view>
				</view>
				<view class="form-item" v-if="details.allDayPrice">
					<view class="form-item-label">全天价格</view>
					<view class="form-item-value">
						<text>￥{{details.allDayPrice }}</text>
						<text class="dan-wei">起</text>
					</view>
				</view>
				<view class="form-item" v-if="details.overtimePrice">
					<view class="form-item-label">超时价格</view>
					<view class="form-item-value">
						<text>￥{{details.overtimePrice}}/</text>
						<text class="dan-wei">小时</text>
					</view>
				</view>

				<view class="form-item" v-if="details.allDayPrice">
					<view class="form-item-label">超公里价格</view>
					<view class="form-item-value">
						<text>￥{{details.allDayPrice}}/</text>
						<text class="dan-wei">公里</text>
					</view>
				</view>

				<view class="form-item" v-if="details.displacement ">
					<view class="form-item-label">排量</view>
					<view class="form-item-value">{{details.displacement}}T</view>
				</view>
				<view class="form-item" v-if="details.transmissionCase">
					<view class="form-item-label">变速箱</view>
					<view class="form-item-value">{{details.transmissionCase}}</view>
				</view>
				<view class="form-item" v-if="details.drive">
					<view class="form-item-label">驱动</view>
					<view class="form-item-value">{{details.drive}}</view>
				</view>
			</view>
			<view class="submit-box">
				<view class="submit" @click="handleSubmit">电话咨询</view>
			</view>
		</view>
	</view>
</template>
<script>
	import {
		realmName
	} from "@/http";
	export default {
		props: {
			details: {
				type: Object,
				default: () => {}
			}
		},
		data() {
			return {
				realmName
			}
		},
		methods:{
			handleSubmit(){
				this.$emit("submit");
			}
		}
	}
</script>

<style lang="scss" scoped>
	.list {
		.list-item {
			background-color: #FFFFFF;
			overflow: hidden;
			border-radius: 60rpx;

			.submit-box {
				display: flex;
				justify-content: flex-end;
				width: 100%;
				margin-top: 50rpx;
			}

			.submit {
				width: 255rpx;
				height: 123rpx;
				line-height: 123rpx;
				color: #FFFFFF;
				font-weight: 500;
				font-size: 30rpx;
				text-align: center;
				background: #FD8F19;
				border-radius: 60rpx 0rpx 60rpx 0rpx;
			}

			.shopping {
				width: 100%;
				height: 510rpx;
			}

			.title {
				color: #1F1F1F;
				font-size: 30rpx;
			}

			.form {
				padding: 0 32rpx;
			}

			.form-item {
				font-size: 26rpx;
				margin-top: 24rpx;
				display: flex;
				justify-content: space-between;

				.form-item-label {
					color: #C1C1C1;
				}

				.form-item-value {
					color: #1F1F1F;
					display: flex;
					align-items: center;
					font-size: 28rpx;
					font-weight: bold;
					.dan-wei {
						font-size: 24rpx;
					}
				}
			}
		}
	}
</style>
